A local area network (LAN) communicates with an external network through a router. FIG. 1 is a schematic structural view of a system for a LAN to communicate with an external network through a default router in the conventional art.
As shown in FIG. 1, the system includes an Ethernet 100, a router 110 and an external network 120. A host A101, a host B102, and a host C103 are devices in the Ethernet 100. The host A101, host B102 and host C103 communicate respectively with the external network 120 through the router 110.
In the schematic structural view of the system shown in FIG. 1, all the hosts in the Ethernet 100 exchange information with the external network 120 through the default router 110. The advantage of this network structure lies in that the network configuration performed by the user is simplified. However, this network structure requires high reliability of the router 110. Once the router 110 fails, the devices in the Ethernet 100 are unable to communicate with the external network 120. Therefore, a backup router is often used to improve the reliability of the system.
The Virtual Router Redundancy Protocol (VRRP) is an error tolerance protocol defined by RFC 2338. The protocol combines a set of routers into a virtual router having the same virtual router IP address. The VRRP backup mechanism provides such a virtual router. When a physical router taking a routing task in the virtual router fails, another backup router substitutes the faulty router to implement the communication between the LAN and the external network.
FIG. 2 is a schematic structural view of the system for communication between a LAN and an external network through a virtual router in the conventional art. Comparing with the embodiment shown in FIG. 1, in addition to the Ethernet 100 and the external network 120, the system further includes a virtual router 230. The Ethernet 100 includes the host A101, the host B102, the host C103 and an internal router 104, and the virtual router 230 includes a router A231, a router B232 and a router C233.
The router A231, the router B232 and the router C233 form a virtual router 230, which is connected to the external network 120, and is further connected to the internal router 104 through the LAN. The address of the virtual router 230 is a virtual IP address, the addresses of the router A231, the router B232 and the router C233 are actual IP addresses, and the actual IP addresses and the virtual IP address are in the same network segment.
The FIG. 1 shows that, when the Ethernet 100 is considerably complicated, the internal router 104 is used to interconnect with the external network 120, that is, the Ethernet 100 communicates with the external network 120 through a router, and the internal router 104 exchanges route information with routers in the external network 120 by routing protocol. The main problem herein is that the routing protocol cannot perceive the virtual IP address of VRRP.
A specific process for implementing the communication between the internal router 104 and the virtual router 230 is described in the following based on the system shown in FIG. 2.
FIG. 3 is a flow chart of the communication between the internal router and the virtual router in the system shown in FIG. 2. The process includes the following.
In step 301, a priority of each physical router in the virtual router is set, and a master router is assigned.
In this step, the priorities of the routers A, B, and C in the virtual router are set according to the VRRP mechanism. The router with the highest priority is assigned as the master router, which is responsible for communication between the internal router and the external network. Here, the priority of the router A is set to be the highest, the router B is lower, and the priority of the router C is the lowest. Therefore, the router A is the master router; the routers B and C are backup routers in a ready and monitoring state. The actual IP addresses of the routers A, B and C are respectively set to be 10.1.1.1, 10.1.1.2 and 10.1.1.3.
In step 302, neighbor relation in the dynamic routing protocol is established between the internal router and the virtual router, and the routing information is exchanged.
In this step, the routers A, B and C use actual IP addresses respectively to establish the neighbor relation in the dynamic routing protocol with the internal router. The method for the physical routers to establish the neighbor relation in the dynamic routing protocol with the internal router is as follows: the internal router sends a dynamic routing protocol control packet to each physical router in the virtual router, in which the dynamic routing protocol control packet may be a Hello packet, a Link State Request (LSR) packet, a Link State Update (LSU) packet, a Link State Advertisement Acknowledgment (LSAck) packet, or other dynamic routing protocol control packets.
The dynamic routing protocol control packet may further include a data description (DD) packet.
The above contents only take OSPF as an example for explanation. The same problem also occurs to other IGP protocols, for example, the Intermediate System to Intermediate System (ISIS) protocol.
In step 303, when the master router fails, master router transiting is performed, and dynamic routing transiting of the internal router is performed.
The internal router uses the actual IP address 10.1.1.1 of the master router A as the IP address of next hop, and sends information to the router A according to the IP address of next hop. When the router A fails, the router B with the next higher priority is elected as the master router according to the VRRP mechanism. The internal router uses the actual IP address 10.1.1.2 of the router B as the IP address of the next hop, and sends information to the router B.
In this step, when the router A fails, the dynamic routing protocol transiting performed by the internal router is as follows: the internal router performs routing convergence, that is, sends the Hello packet to the router A; if no acknowledgment information is received in a specified period of time, the router A is considered to fail, and the neighbor list of the router A is deleted; then, a new routing calculation is performed, that is, the actual IP address 10.1.1.2 of the router B is used as the IP address of the next hop.
In the process of the transiting of the master router and the dynamic routing protocol transiting of the internal router, the following problems occur: when the router A fails, according to the VRRP mechanism, the failure can be detected rapidly, the router B is transited as the master router within a short time. However, the perception of the Hello packet to a neighboring failure is slow, and the convergence process of the dynamic routing protocol of the internal router and the new route calculation costs some time. Here, the internal router still considers the router A as the master router, and sends information to the router A, but the VRRP mechanism has already transited the router B as the master router. Therefore, the master router B cannot receive the information sent by the internal router. Because the transited master router B cannot receive the information sent by the internal router, the interval of the information sent from the internal router to the external network is quite long.
It is obvious that, in the conventional art, the internal router uses the actual IP address of the master router as the IP address of the next hop and sends the information that is to be sent to the external network to the master router. When the master router is transited, the transited master router cannot receive the information sent by the internal router rapidly. Therefore, according to the technical solutions in the conventional art, when the master router is transited, the interval when the internal router sends information to the external network is long.